<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>有医说疑</title>
    <div th:replace="commonPage::comLink"></div>
</head>
<body>
<div th:replace="commonPage::#loader"></div>

<div th:include="commonPage::comIndexHeaderMune"></div>


<div th:replace="commonPage::#loader"></div>
<div th:replace="commonPage::#loading-area"></div>

<!--      论坛布局       -->
<div class="container-fluid  padding-bottom-120px padding-top-140px">
    <div class="row">
        <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 mx-auto">


            <!--排序-->
            <ul th:if="${classify}!=null" class="nav nav-tabs btn-right">
                <li role="presentation" th:class="${selectWay}=='view_count'? 'active':'user-center'"><a
                        th:href="@{'/communityCenter/'+ ${classify} +'/view_count'}">热度</a></li>
                <li role="presentation" th:class="${selectWay}=='last_reply_time'? 'active':'user-center'"><a
                        th:href="@{'/communityCenter/'+ ${classify} +'/last_reply_time'}">最近回复</a></li>
                <li role="presentation" th:class="${selectWay}=='comment_count'? 'active':'user-center'"><a
                        th:href="@{'/communityCenter/'+ ${classify} +'/comment_count'}">评论数</a></li>
            </ul>

            <h2><span class="glyphicon glyphicon-th-list" aria-hidden="true">  发现</span></h2>
            <hr>
            <div th:each="question : ${pageInitDTO.list}">
                <div class="media">
                    <div class="media-left media-margin">
                        <a href="#">
                            <img class="media-object " th:src="${question.user.imgUrl}">
                        </a>

                    </div>
                    <div class="media-body media-margin">
                    <span class="btn-right"
                          th:text="${#dates.format(question.lastReplyTime,'yyyy-MM-dd HH:mm')}"></span>
                        <a th:href="@{'/question/'+${question.id}}">
                            <h4 class="media-heading title-question" th:text="${question.title}"></h4>
                            <span class="text-about" style="padding-right: 30px" th:text="${question.simpDes}"></span>
                        </a>
                        <br>
                        <div class="icon-about btn-right">
                            <i class="fa fa-eye">&emsp;<span th:text="${question.viewCount}"></span></i>
                            &emsp;
                            <i class="glyphicon glyphicon-comment"></i>
                            <span th:text="${question.commentCount}"></span>
                            &emsp;
                            <span th:text="${question.likeCount}" class="fa fa-thumbs-o-up"></span>
                        </div>
                    </div>
                </div>
                <hr>
            </div>


            <!--            搜索问题的分页-->

            <nav aria-label="Page navigation" class="btn-right">
                <ul class="pagination" th:if="${classify}==null">
                    <li>
                        <a th:href="@{'/search' (search=${keyValue},page=1)}" aria-label="First"
                           th:if="${pageInitDTO.showFirstPage}">
                            <span aria-hidden="true">首页</span>
                        </a>
                        <span aria-hidden="true" th:if="${pageInitDTO.showFirstPage == false}" class="btn-disabled">
                            首页
                        </span>
                    </li>
                    <li>
                        <a th:if="${pageInitDTO.showPrevious}" th:href="@{'/search'  ( search=${keyValue},page=${pageInitDTO.page}-1)}"
                           aria-label="Previous">
                            <span aria-hidden="true">上一页</span>
                        </a>
                        <span th:if="${pageInitDTO.showPrevious == false}" aria-hidden="true"
                              class="btn-disabled">上一页</span>
                    </li>

                    <li th:each="page : ${pageInitDTO.pages}" th:class="${pageInitDTO.page == page}? 'active':''">
                        <a th:href="@{'/search'(search=${keyValue},page=${page})}"
                           th:text="${page}">
                        </a>
                    </li>

                    <li>
                        <a th:href="@{'/search'  ( search=${keyValue},page=${pageInitDTO.page}+1)}" aria-label="Next"
                           th:if="${pageInitDTO.showNext}">
                            <span aria-hidden="true">
                                下一页
                            </span>
                        </a>
                        <span th:if="${pageInitDTO.showNext == false}" class="btn-disabled">
                                下一页
                        </span>
                    </li>
                    <li>
                        <a th:href="@{'/search'(search=${keyValue},page=${pageInitDTO.totalPage})}" aria-label="End"
                           th:if="${pageInitDTO.showEndPage}">
                            <span aria-hidden="true">
                                尾页
                            </span>
                        </a>
                        <span aria-hidden="true" class="btn-disabled" th:if="${pageInitDTO.showEndPage==false}">
                            尾页
                        </span>
                    </li>
                </ul>


                <!--              所有问题的分页  -->
                <ul class="pagination" th:if="${classify}!=null">
                    <li>
                        <a th:href="@{'/communityCenter/' ${selectWay}(page=1)}" aria-label="First"
                           th:if="${pageInitDTO.showFirstPage}">
                            <span aria-hidden="true">首页</span>
                        </a>
                        <span aria-hidden="true" th:if="${pageInitDTO.showFirstPage == false}" class="btn-disabled">
                            首页
                        </span>
                    </li>
                    <li>
                        <a th:if="${pageInitDTO.showPrevious}"
                           th:href="@{'/communityCenter/' + ${classify} + '/' + ${selectWay}(page=${pageInitDTO.page}-1)}"
                           aria-label="Previous">
                            <span aria-hidden="true">上一页</span>
                        </a>
                        <span th:if="${pageInitDTO.showPrevious == false}" aria-hidden="true"
                              class="btn-disabled">上一页</span>
                    </li>

                    <li th:each="page : ${pageInitDTO.pages}" th:class="${pageInitDTO.page == page}? 'active':''">
                        <a th:href="@{'/communityCenter/' + ${classify} + '/' + ${selectWay}(page=${page})}"
                           th:text="${page}">

                        </a>
                    </li>

                    <li>
                        <a th:href="@{'/communityCenter/' + ${classify} + '/' + ${selectWay}(page=${pageInitDTO.page}+1)}"
                           aria-label="Next"
                           th:if="${pageInitDTO.showNext}">
                            <span aria-hidden="true">
                                下一页
                            </span>
                        </a>
                        <span th:if="${pageInitDTO.showNext == false}" class="btn-disabled">
                                下一页
                        </span>
                    </li>
                    <li>
                        <a th:href="@{'/communityCenter/' + ${classify} + '/' + ${selectWay}(page=${pageInitDTO.totalPage})}"
                           aria-label="End"
                           th:if="${pageInitDTO.showEndPage}">
                            <span aria-hidden="true">
                                尾页
                            </span>
                        </a>
                        <span aria-hidden="true" class="btn-disabled" th:if="${pageInitDTO.showEndPage==false}">
                            尾页
                        </span>
                    </li>
                </ul>
            </nav>

        </div>
        <div class="col-lg-4 col-md-12 col-sm-12 col-xs-12 ">

            <form class="navbar-form btn-right" th:action="@{/search}" method="get" onsubmit="return checkSearch()">
                <div class="form-group">
                    <input type="text" id="search" name="search" class="form-control" style="width: 300px"
                           placeholder="搜索能更快找到你的问题哦">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>

            <h3>友情链接</h3>
            <hr>
                        <a href="https://blog.csdn.net/Aatroy"> 作者的CSDN </a>
                        <br>
                        <a href="https://gitee.com/aatroy"> 作者的 Gitee</a>
                        <br>
                        <a href="https://qm.qq.com/cgi-bin/qm/qr?k=TGPZgRZezRYSiVot6p_ouNA3LG6PVvGR&noverify=0">点击 联系作者 </a>
                        <br>
                        <img th:src="@{/images/contactMe.jpg}" class="contact-me">

        </div>
    </div>
</div>
<div th:replace="commonPage::scrollTop"></div>
<div th:replace="commonPage::comFooter">
</div>
<div th:replace="commonPage::comScript">
</div>
</body>
</html>